var Login = {
	Initial : function(){
		$("#loginform").submit(function(evt){
			Login.OnSubmit();
			evt.preventDefault();
		});
	},
	OnSubmit : function(){
		var user = $("#loginform").find("input[@name=user]").val();
		var pwd = $("#loginform").find("input[@name=pwd]").val();
		var rem =  $("#rememberme").attr("checked") ? true : false;
		var param = {mod:"user",op:"login",user:user,pwd:pwd,rem:rem};
		Ajax.Request(param,function(json){
			if(json.data == 1) window.location = "../admin/index.php";
			else alert(json.data);
		});
	}
};
$(Login.Initial);
